xen/arm: Keep memory nodes in device tree when Xen boots from EFI
authorWei Chen <wei.chen@arm.com>
Fri, 10 Jun 2022 05:53:10 +0000 (13:53 +0800)
committerJulien Grall <jgrall@amazon.com>
Fri, 17 Jun 2022 08:36:12 +0000 (09:36 +0100)
commit53701ecb8f8b124b62ff50925032468c2df3745e
tree69d3a81888ec7419322f6569dfbfe484434a3a8f
parent7f96859b0d00dd7f6e6fefa66706268cc2761a3d
xen/arm: Keep memory nodes in device tree when Xen boots from EFI

In current code, when Xen is booting from EFI, it will delete
all memory nodes in device tree. This would work well in current
stage, because Xen can get memory map from EFI system table.
However, EFI system table cannot completely replace memory nodes
of device tree. EFI system table doesn't contain memory NUMA
information. Xen depends on ACPI SRAT or device tree memory nodes
to parse memory blocks' NUMA mapping. So in EFI + DTB boot, Xen
doesn't have any method to get numa-node-id for memory blocks any
more. This makes device tree based NUMA support become impossible
for Xen in EFI + DTB boot.

So in this patch, we will keep memory nodes in device tree for
NUMA code to parse memory numa-node-id later.

As a side effect, if we still parse boot memory information in
early_scan_node, bootmem.info will calculate memory ranges in
memory nodes twice. So we have to prevent early_scan_node to
parse memory nodes in EFI boot.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Tested-by: Jiamei Xie <jiamei.xie@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/bootfdt.c
xen/arch/arm/efi/efi-boot.h